// 图片管理API - 简化版本，方便修改
import { request } from '@/utils/request'

/**
 * 图片管理API
 * 可以直接修改参数和请求地址
 */
export const imageAPI = {
  
  // 获取图片列表
  getImageList: (params: any) => {
    return request.post('/api/getImageList', params)
  },

  // 获取图片列表数量
  getImageListCount: (params: any) => {
    return request.post('/api/getImageListCount', params)
  },

  // 删除图片
  deleteImage: (params: any) => {
    return request.post('/api/deleteImage', params)
  },


  
  // 上传图片
  // 参数：FormData with image file
  upload: (params: any) => {
    return request.post('/api/imageUpload', params)
  },
  
  // 删除图片
  // 参数：{ id: 1 }
  delete: (params: any) => {
    return request.post('/api/imageDelete', params)
  },
  
  // 获取图片详情
  // 参数：{ id: 1 }
  getDetail: (params: any) => {
    return request.post('/api/imageDetail', params)
  },
  
  // 批量上传图片
  // 参数：FormData with multiple image files
  batchUpload: (params: any) => {
    return request.post('/api/imageBatchUpload', params)
  },
  
  // 批量删除图片
  // 参数：{ ids: [1, 2, 3] }
  batchDelete: (params: any) => {
    return request.post('/api/imageBatchDelete', params)
  },
  
  // 更新图片信息
  // 参数：{ id: 1, fileName: '新文件名', category: '分类', ... }
  update: (params: any) => {
    return request.post('/api/imageUpdate', params)
  },
  
  // 获取图片分类
  getCategories: () => {
    return request.get('/api/imageCategories')
  },
  
  // 图片压缩
  // 参数：{ id: 1, quality: 80 }
  compress: (params: any) => {
    return request.post('/api/imageCompress', params)
  }
}

export default imageAPI 